package com.zelix;

import java.awt.*;
import java.io.*;
import javax.swing.*;
import javax.swing.text.JTextComponent;

abstract class t2 extends g2
    implements eo
{

    sp d;
    wc e;
    JFrame f;
    yw g;
    nh h;
    Reader i;
    PrintWriter j;
    Font k;
    FontMetrics l;
    JButton m;
    JButton n;
    JButton o;
    JButton p;
    k4 q;
    JCheckBox r;
    JCheckBox s;
    JComboBox c;
    DefaultComboBoxModel t;
    JTextField u;
    JButton v;
    JTextField w;
    JButton x;
    boolean y;
    private static String z[];

    t2(String s1, String s2, JFrame jframe, sp sp1, wc wc, nh nh1, yw yw1)
    {
        k = zo.b();
        q = new k4(true);
        r = new JCheckBox(z[2]);
        s = new JCheckBox(z[1]);
        u = new JTextField();
        v = new JButton(z[0]);
        w = new JTextField();
        x = new JButton(z[0]);
        d = sp1;
        e = wc;
        f = jframe;
        h = nh1;
        g = yw1;
        setFont(k);
        a(s1, s2);
        zz.b(n);
    }

    static void a(t2 t2_1)
    {
        t2_1.g();
    }

    static void b(t2 t2_1)
    {
        t2_1.h();
    }

    private void a(String s1, JTextField jtextfield)
    {
        qz aqz[] = {
            new vz(), new rz()
        };
        m4 m4_1 = new m4(new File(zo.h), false, 1, aqz, 0, true);
        int i1 = m4_1.a(this, s1);
        if(i1 == 1)
        {
            File file = m4_1.e();
            jtextfield.setText(file.getAbsolutePath());
        }
    }

    final void f()
    {
        y = true;
        a();
        g.a();
    }

    private void g()
    {
        a(z[5], u);
    }

    private void h()
    {
        a(z[28], w);
    }

    public final void a()
    {
        super.a();
        if(!y)
            g.a();
    }

    private void d()
    {
        if(i != null)
            try
            {
                i.close();
            }
            catch(IOException ioexception) { }

    }

    void b(String s1)
    {
        m = new JButton(z[26]);
        m.setToolTipText(to.b(to.V));
        n = new JButton(z[24]);
        n.setToolTipText(s1);
        o = new JButton(z[27]);
        o.setToolTipText(to.b(to.Z));
        p = new JButton(z[25]);
        p.setToolTipText(to.b(to.ab));
    }

    protected boolean a(String s1, File file)
    {
label0:
        {
            boolean flag = tb.b;
            try
            {
                BufferedReader bufferedreader;
label1:
                {
                    String s2 = re.a(file);
                    if(s2 != null)
                    {
                        bufferedreader = new BufferedReader(new InputStreamReader(new FileInputStream(file), s2));
                        if(!flag)
                            break label1;
                    }
                    bufferedreader = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
                }
                StringBuffer stringbuffer = new StringBuffer();
                String s3;
                while((s3 = bufferedreader.readLine()) != null) 
                {
                    stringbuffer.append(s3);
                    stringbuffer.append(zo.e);
                }
                d();
                i = new StringReader(stringbuffer.toString());
                bufferedreader.close();
                break label0;
            }
            catch(IOException _ex)
            {
                new f2(this, z[4], z[3] + s1);
                u.selectAll();
                zz.b(u);
                return false;
            }
        }
        return true;
    }

    protected boolean b(String s1, File file)
    {
        try
        {
            String s2 = qe.a();
            if(s2 != null)
            {
                j = new PrintWriter(new BufferedWriter(new OutputStreamWriter(new FileOutputStream(s1), s2), 2048));
                d.v = s2;
                if(!tb.b)
                    break MISSING_BLOCK_LABEL_158;
            }
            OutputStreamWriter outputstreamwriter = new OutputStreamWriter(new FileOutputStream(s1));
            j = new PrintWriter(new BufferedWriter(outputstreamwriter, 2048));
            d.v = null;
        }
        catch(IOException _ex)
        {
            new f2(this, z[4], z[3] + s1);
            w.selectAll();
            zz.b(w);
            return false;
        }
        return true;
    }

    public Action d()
    {
        return new j1(this);
    }

    abstract Dimension i();

    protected abstract void j();

    boolean k()
    {
        if(r.isSelected())
        {
            if(u.getText().trim().equals(""))
            {
                u.selectAll();
                new f2(this, z[6], z[12]);
                zz.b(u);
                return false;
            }
            String s1 = u.getText().trim();
            File file = new File(s1);
            if(file.exists() && !file.canRead())
            {
                new f2(this, z[4], z[13] + s1);
                u.selectAll();
                zz.b(u);
                return false;
            }
            if(a(file.getAbsolutePath(), h.m(), z[11], u))
                return false;
            if(a(file.getAbsolutePath(), h.u(), z[14], u))
                return false;
            boolean flag = a(s1, file);
            if(!flag)
                return false;
        } else
        {
            d();
        }
        if(s.isSelected())
        {
            if(w.getText().trim().equals(""))
            {
                w.selectAll();
                new f2(this, z[6], z[15]);
                zz.b(w);
                return false;
            }
            String s2 = w.getText().trim();
            File file1 = new File(s2);
            if(file1.exists() && !file1.canWrite())
            {
                new f2(this, z[4], z[10] + s2);
                w.selectAll();
                zz.b(w);
                return false;
            }
            if(a(file1.getAbsolutePath(), h.m(), z[11], w))
                return false;
            if(a(file1.getAbsolutePath(), h.u(), z[14], w))
                return false;
            else
                return b(s2, file1);
        } else
        {
            return true;
        }
    }

    private boolean a(String s1, String s2, String s3, JTextField jtextfield)
    {
        if(s1.equals(s2) || !oc.h && s1.equalsIgnoreCase(s2))
        {
            new f2(this, z[6], z[7] + s1 + z[8] + s3 + z[9]);
            jtextfield.selectAll();
            zz.b(jtextfield);
            return true;
        } else
        {
            return false;
        }
    }

    final void l()
    {
        if(k())
        {
            y = true;
            a();
            q();
            g.a(d, new Integer(1));
        }
    }

    final void m()
    {
        if(k())
        {
            y = true;
            a();
            q();
            g.a(d, new Integer(2));
        }
    }

    void n()
    {
    }

    void o()
    {
    }

    void p()
    {
        boolean flag;
label0:
        {
            flag = tb.b;
            if(d.c)
            {
                r.setSelected(true);
                if(!flag)
                    break label0;
            }
            r.setSelected(false);
        }
label1:
        {
            if(d.g != null && d.g.length > 0)
                u.setText(d.g[0].a());
            u.setEnabled(r.isSelected());
            v.setEnabled(r.isSelected());
            if(d.d)
            {
                s.setSelected(true);
                if(!flag)
                    break label1;
            }
            s.setSelected(false);
        }
        if(d.f != null)
            w.setText(d.f);
        w.setEnabled(s.isSelected());
        x.setEnabled(s.isSelected());
        c.setSelectedIndex(d.b);
        n();
    }

    void q()
    {
        boolean flag;
label0:
        {
            flag = tb.b;
            d.c = r.isSelected();
            String s1 = u.getText().trim();
            if(s1.length() > 0)
            {
                hy hy1 = new hy(s1);
                if(d.c)
                    hy1.a(i);
                d.g = new hy[1];
                d.g[0] = hy1;
                if(!flag)
                    break label0;
            }
            d.g = null;
        }
label1:
        {
            d.d = s.isSelected();
            if(d.d && w.getText().trim().length() > 0)
            {
                d.h = j;
                if(!flag)
                    break label1;
            }
            d.h = null;
        }
        d.f = w.getText().trim();
        d.b = c.getSelectedIndex();
        o();
    }

    void r()
    {
        j0 j0_1 = new j0(q);
        q.setLayout(j0_1);
        StringBuffer stringbuffer = new StringBuffer();
        a(stringbuffer);
        j0_1.e(stringbuffer.toString());
    }

    abstract void a(StringBuffer stringbuffer);

    public void a(String s1, String s2)
    {
        setTitle(s1);
        Container container = getContentPane();
        j0 j0_1 = new j0(container);
        container.setLayout(j0_1);
        Dimension dimension = i();
        b(s2);
        v.setToolTipText(to.b(to.Bb));
        x.setToolTipText(to.b(to.Cb));
        bb bb1 = new bb(this);
        addWindowListener(bb1);
        tp tp1 = new tp(this);
        v.addActionListener(tp1);
        x.addActionListener(tp1);
        m.addActionListener(tp1);
        n.addActionListener(tp1);
        o.addActionListener(tp1);
        p.addActionListener(tp1);
        i i1 = new i(this);
        m.addKeyListener(i1);
        n.addKeyListener(i1);
        o.addKeyListener(i1);
        p.addKeyListener(i1);
        up up1 = new up(this);
        r.addItemListener(up1);
        s.addItemListener(up1);
        container.add(q, z[18]);
        l = getFontMetrics(k);
        r();
        container.add(m, z[20]);
        container.add(n, z[23]);
        container.add(o, z[22]);
        container.add(p, z[16]);
        String s3 = z[17] + dimension.width + ";" + z[19] + dimension.height;
        j0_1.e(z[21] + s3);
        f.setEnabled(false);
        p();
        setIconImage(zo.a(this));
        pack();
        Dimension dimension1 = getSize();
        Point point = f.getLocationOnScreen();
        Dimension dimension2 = f.getSize();
        int k1 = (dimension2.width / 2 - dimension1.width / 2) + point.x;
        int l1 = (dimension2.height / 2 - dimension1.height / 2) + point.y;
        k1 = Math.max(0, k1);
        l1 = Math.max(0, l1);
        setLocation(k1, l1);
        zz.a(this, true);
    }

    private static String dees(char[] chs) {
        for (int i = 0; i < chs.length; i++) {
            byte key = 0;
            switch (i % 5) {
                case 0:
                    key = 0x31;
                    break;
                case 1:
                    key = 11;
                    break;
                case 2:
                    key = 67;
                    break;
                case 3:
                    key = 86;
                    break;
                default:
                    key = 117;
                    break;
            }
            chs[i] ^= key;
        }
        return new String(chs).intern();
    }

    static 
    {
        String as[];
        as = new String[29];
        as[0] = "\037+mv[";
        as[1] = "Ay,2\000Rnc7URc\"8\022T+/9\022\021m*:\020\013";
        as[2] = "Dx&v\034_{6\"URc\"8\022T+/9\022\021m*:\020\013";
        as[3] = "ty19\007\021d33\033Xe$v";
        as[4] = "wb/3Uty19\007";
        as[5] = "bn/3\026E+\n8\005D\177c\025\035Pe$3U}d$v3Xg&";
        as[6] = "ty19\007";
        as[7] = "~~7&\000E+ >\024_l&v\031^lc0\034]nct";
        as[8] = "\023+ :\024Bc&%UFb7>U";
        as[9] = "\021m*:\020\021e\";\020\037";
        as[10] = "rj-q\001\021|1?\001T+79U";
        as[11] = "k@\016v\031^l";
        as[12] = "p+%?\031T+-7\030T+%9\007\021\177+3UXe3#\001\021h+7\033Vnc:\032V+.#\006E+!3UTe73\007To";
        as[13] = "rj-q\001\021y&7\021\021m19\030\021";
        as[14] = "Ey*;U]d$";
        as[15] = "p+%?\031T+-7\030T+%9\007\021\177+3URc\"8\022T+/9\022\021f6%\001\021i&v\020_\177&$\020U";
        as[16] = "Yn/&7Ee";
        as[17] = "]j:9\000E%.?\033fb'\"\035\f";
        as[18] = "\\j*8%_g";
        as[19] = "]j:9\000E%.?\033yn*1\035E6";
        as[20] = "Ay& \034^~0\024\001_";
        as[21] = "]j:9\000E%.?\033fb'\"\035\fi78\"Xo7>_\005 qcNS\177-\001\034U\177+k\030Psk&\007T}*9\000BI78[Un%7\000]\177\024?\021Ecov\032ZI78[Un%7\000]\177\024?\021Ecov\026Pe 3\031s\177-x\021Tm\"#\031E\\*2\001Y'c>\020]{\001\"\033\037o&0\024Dg7\001\034U\177+\177NS\177-\036\020Xl+\"H\\j;~\005Cn5?\032Dx\001\"\033\037o&0\024Dg7\036\020Xl+\"Y\021d(\024\001_%'3\023P~/\"=Tb$>\001\035+ 7\033Rn/\024\001_%'3\023P~/\"=Tb$>\001\035++3\031AI78[Un%7\000]\177\0133\034Vc7\177N\\j*8%_gm\"\032A6sm\030Pb-\006\033]%/3\023E6sm\030Pb-\006\033]%!9\001Ed.k\026^e77\034_n1x\027^\17779\030\034i78=Tb$>\001\034:sm\030Pb-\006\033]%1?\022Y\177~5\032_\177\"?\033Tym$\034Vc7m\005Cn5?\032Dx\001\"\033\037\177,&H\\j*8%_gm4\032E\177,;^\00403$\020Gb,#\006s\177-x\026Te73\007i6 9\033Ej*8\020C%4?\021EcigG\036:sfNAy& \034^~0\024\001_%4?\021Ec~4\001_\\*2\001Y03$\020Gb,#\006s\177-x\035Tb$>\001\fi78=Tb$>\001\nd(\024\001_%79\005\ff\"?\033ae/x\027^\17779\030\032>x9\036s\177-x\026Te73\007i6 9\033Ej*8\020C%4?\021EcieB\036:sfN^`\001\"\033\037|*2\001Y6!\"\033fb'\"\035\nd(\024\001_%+3\034Vc7k\027Ee\0133\034Vc7m\026Pe 3\031s\177-x\001^{~;\024Xe\0238\031\037i,\"\001^fhcNRj-5\020]I78[Rn-\"\020CS~5\032_\177\"?\033Tym!\034U\177+|C\003$rfE\nh\"8\026Tg\001\"\033\037|*2\001Y6!\"\033fb'\"\035\nh\"8\026Tg\001\"\033\037c&?\022Y\177~4\001_C&?\022Y\177x>\020]{\001\"\033\037\177,&H\\j*8%_gm4\032E\177,;^\0040+3\031AI78[Rn-\"\020CS~5\032_\177\"?\033Tym!\034U\177+|M\006$rfE\nc&:\005s\177-x\002Xo7>HS\177-\001\034U\177+m\035Tg3\024\001_%+3\034Vc7k\027Ee\0133\034Vc7m";
        as[22] = "Rj-5\020]I78";
        as[23] = "^`\001\"\033";
        as[24] = "~@";
        as[25] = "yn/&";
        as[26] = "ay& \034^~0";
        as[27] = "rj-5\020]";
        as[28] = "bn/3\026E+\f#\001A~7v6Yj-1\020\021G,1Uwb/3";
        for (int i = 0; i < as.length; i++) {
            as[i] = dees(as[i].toCharArray());
        }
        z = as;

    }
}